package com.example.rabbitmqstudy.service;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author admin
 * @date 2021/07/13 10:53
 */
@Component
public class Sender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(String name){
        String context = "hello" + name;
        System.out.println("Sender ： " + context);
        this.amqpTemplate.convertAndSend("hello",context);
    }

}
